package com.yangguang.huahui.mvp.presenter;

import com.yangguang.huahui.entity.ClientNeeds;
import com.yangguang.huahui.mvp.model.PurchaseModel;
import com.yangguang.huahui.mvp.view.ClientNeedsView;
import com.yangguang.huahui.rx.RxManager;
import com.yangguang.huahui.rx.RxSubscriber;

/**
 * Created by Administrator on 2017/3/6.
 */

public class ClientNeedsPresenter extends BasePresenter<ClientNeedsView>{
    PurchaseModel model;

    public ClientNeedsPresenter() {
        model = new PurchaseModel();
    }

    public void client_needs_list(int page){
        mSubscription = RxManager.getInstance().doSubscribe(model.client_needs_list(page), new RxSubscriber<ClientNeeds>(false) {
            @Override
            protected void _onNext(ClientNeeds clientNeeds) {
                mView.onSuccess(clientNeeds);
            }

            @Override
            protected void _onError() {
                mView.onError();
            }
        });
    }
}
